import React, { Suspense } from "react";
import Spinner from "../components/spinner";

// () => JSX.Element 具体类型
const lazyLoad = (Comp: React.LazyExoticComponent<any>) => {
  return (
    <Suspense fallback={<Spinner />}>
      <Comp />
    </Suspense>
  );
};

export default lazyLoad;
